package com.example.feed.multichannel;

import android.content.Context;

import androidx.annotation.NonNull;

import com.x.uikit.channel.feed.AbstractCard;
import com.x.uikit.link.XParams;

public abstract class BaseCard extends AbstractCard<BaseCardData> {
    private BaseCardData mData;

    public BaseCard(@NonNull Context context) {
        super(context);
        setOnClickListener(v -> {
            if (mData == null) {
                return;
            }
            sendEvent(CardEventHandler.EventIds.CARD_CLICK, XParams.obtain("url", mData.url));
        });
    }

    @Override
    public void bind(int position, BaseCardData data) {
        mData = data;
        super.bind(position, data);
    }
}
